package com.project.config.rabbitMQ;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.connection.CorrelationData;

import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.stereotype.Component;

import java.util.logging.Logger;

/**
 * ClassName: Callbacks <br/>
 * Description: <br/>
 * date: 2019/1/4 9:26<br/>
 *
 * @author lenovo<br />
 * @since JDK 1.8
 */
@Component
public class PayCallback implements RabbitTemplate.ReturnCallback, RabbitTemplate.ConfirmCallback {

    /*Logger log = Logger.getLogger("Callbacks");*/

    /**
     * Description: 消息成功投递到rabbitMQ交换机时回调函数 <br/>
     * @author: lenovo<br/>
     * @date: 2019/1/4 9:29<br/>
     * @param:<br/>
     * @return:
     */
    @Override
    public void confirm(CorrelationData correlationData, boolean b, String s) {
       /* log.info("放入交换机成功");*/
    }

    /**
     * Description: 消息投递到rabbitMQ消息队列失败回调<br/>
     * @author: lenovo<br/>
     * @date: 2019/1/4 9:29<br/>
     * @param:<br/>
     * @return:
     */
    @Override
    public void returnedMessage(Message message, int i, String s, String s1, String s2) {
       /* log.info("放入队列失败");*/
    }
}
